const express = require("express");
const path = require("path");
const app = express();

// 设置静态文件目录
app.use(express.static(path.join(__dirname, "../build/web")));

// 所有请求都发送到index.html
app.get("*", function (req, res) {
  res.sendFile(path.join(__dirname, "/web/index.html"));
});

const port = process.env.PORT || 8484;
app.listen(port, () => {
  console.log(`Server is running on port ${port}`);
});
